package com.zhihuishu;

import com.hankcs.hanlp.HanLP;
import com.hankcs.hanlp.seg.common.Term;

import java.util.List;

/**
 * @Author: wangjinliang
 * @Date: 2019/5/31 10:14
 */
public class HanlpBaseDemo {
    public static void main(String[] args) {
        String result = "中华人民共和国http://www.baidu.com666";
        List<Term> segmentList = HanLP.segment(result);
        printResult(segmentList);
    }

    private static void printResult(List<Term> segmentList) {
        segmentList.forEach(term -> {
            System.out.println(term.word + "  --->>  " + term.nature.toString());
        });
    }
}
